﻿using AgencyManagerSystem.Model;
using System.Collections.Generic;
using System.Linq;

namespace AgencyManagerSystem.DataFetcher
{
    public class CodeIncrementFetcher : BaseFetcher<CodeIncrementModel>
    {
        public CodeIncrementModel GetByType(string type)
        {
            Condition[] conditions = new Condition[] { new Condition() { Key = "Type", Op = "=", Value = type }};
            var list = List(conditions);
            if (list.Count > 0)
                return list.First();
            else
                return null;
        }
    }
}
